home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / Mesa-1.2.1 / widgets / include / GL / GLwDrawAP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-05  |  4.3 KB  |  161 lines

  1. /* GLwDrawingAreaP.h -- Mesa GL Widget for X11 Toolkit Programming
  2.    Copyright (C) 1995 by
  3.      Jeroen van der Zijp <jvz@cyberia.cfdrc.com>
  4.      Thorsten Ohl <Thorsten.Ohl@Physik.TH-Darmstadt.de>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License as published by the Free Software Foundation; either
  9.    version 2 of the License, or (at your option) any later version.
  10.  
  11.    This library is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU Library General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU Library General Public
  17.    License along with this library; if not, write to the Free Software
  18.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.    $Id: GLwDrawAP.h,v 1.5 1995/04/08 16:25:29 ohl Exp $
  21.  */
  22.  
  23. #ifndef _GLwDrawingAreaP_h
  24. #define _GLwDrawingAreaP_h
  25.  
  26. #ifdef __GLX_MOTIF
  27. #include <Xm/PrimitiveP.h>
  28. #include <GL/GLwMDrawA.h>
  29. #else
  30. #include <GL/GLwDrawA.h>
  31. #endif
  32.  
  33. #ifndef __GNUC__
  34. #define __FUNCTION__ "???"
  35. #endif
  36.  
  37. #ifdef DEBUG
  38. #define GLwDebug(_widget) \
  39.    (((GLwDrawingAreaWidget)_widget)->glwDrawingArea.debug)
  40. #define LOG(w) \
  41.    if (GLwDebug(w)) \
  42.      fprintf (stderr, "%s():%s(%d) of %s (class %s, address %p)\n", \
  43.        __FUNCTION__, __FILE__, __LINE__, \
  44.        (w)->core.name, XtClass(w)->core_class.class_name, (w))
  45. #else
  46. #define LOG(w)
  47. #endif
  48.  
  49. struct cmap_cache_entry
  50. {
  51.   Display *dpy;
  52.   VisualID vid;
  53.   Colormap cmap;
  54. };
  55.  
  56. struct cmap_cache
  57. {
  58.   struct cmap_cache_entry *entries;
  59.   int next_entry;
  60.   int allocated_entries;
  61. };
  62.  
  63. typedef struct _GLwDrawingAreaClassPart
  64.   {
  65.     caddr_t extension;
  66.     struct cmap_cache colormaps;
  67.   }
  68. GLwDrawingAreaClassPart;
  69.  
  70. #ifdef __GLX_MOTIF
  71.  
  72. /* Motif class record */
  73. typedef struct _GLwMDrawingAreaClassRec
  74.   {
  75.     CoreClassPart core_class;
  76.     XmPrimitiveClassPart primitive_class;
  77.     GLwDrawingAreaClassPart glwDrawingArea_class;
  78.   }
  79. GLwMDrawingAreaClassRec;
  80.  
  81. extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec;
  82.  
  83. #else
  84.  
  85. /* Xt class record */
  86. typedef struct _GLwDrawingAreaClassRec
  87.   {
  88.     CoreClassPart core_class;
  89.     GLwDrawingAreaClassPart glwDrawingArea_class;
  90.   }
  91. GLwDrawingAreaClassRec;
  92.  
  93. extern GLwDrawingAreaClassRec glwDrawingAreaClassRec;
  94.  
  95. #endif
  96.  
  97. /************************************************************************
  98.  *                      New Mesa Widget Resources                        *
  99.  ************************************************************************/
  100.  
  101. typedef struct
  102.   {
  103.     int *attribList;        /* Attribute list for use in glXChooseVisual */
  104.     XVisualInfo *visualInfo;    /* Chosen visual */
  105.     Boolean installColormap;
  106.     Boolean allocateBackground;
  107.     Boolean allocateOtherColors;
  108.     Boolean installBackground;
  109.     Boolean rgba;        /* True color mode or index mode */
  110.     Boolean doublebuffer;    /* Double buffering? */
  111.     Boolean stereo;        /* Stereo mode? */
  112.     XtCallbackList ginitCallback;
  113.     XtCallbackList resizeCallback;
  114.     XtCallbackList exposeCallback;
  115.     XtCallbackList inputCallback;
  116.     int bufferSize;        /* Smallest index buffer size (for index mode) */
  117.     int level;            /* Overlay level */
  118.     int auxBuffers;        /* Number of auxiliary buffers */
  119.     int redSize;        /* Bits/channel red */
  120.     int greenSize;        /* Bits/channel green */
  121.     int blueSize;        /* Bits/channel blue */
  122.     int alphaSize;        /* Bits/channel coverage */
  123.     int depthSize;        /* Bits for Z-Buffer */
  124.     int stencilSize;        /* Bits for stencil buffer */
  125.     int accumRedSize;        /* Bits/channel red accu-buffer */
  126.     int accumGreenSize;        /* Bits/channel green accu-buffer */
  127.     int accumBlueSize;        /* Bits/channel blue accu-buffer */
  128.     int accumAlphaSize;        /* Bits/channel coverage accu-buffer */
  129.  
  130.     Boolean debug;
  131.     Boolean attribList_allocated;    /* Bookkeeping  */
  132.     Boolean visualInfo_allocated;
  133.   }
  134. GLwDrawingAreaPart;
  135.  
  136.  
  137. #ifdef __GLX_MOTIF
  138.  
  139. /* Motif-based widget */
  140. typedef struct _GLwMDrawingAreaRec
  141.   {
  142.     CorePart core;
  143.     XmPrimitivePart primitive;
  144.     GLwDrawingAreaPart glwDrawingArea;
  145.   }
  146. GLwMDrawingAreaRec;
  147.  
  148. #else
  149.  
  150. /* Xt-based widget */
  151. typedef struct _GLwDrawingAreaRec
  152.   {
  153.     CorePart core;
  154.     GLwDrawingAreaPart glwDrawingArea;
  155.   }
  156. GLwDrawingAreaRec;
  157.  
  158. #endif
  159.  
  160. #endif /* _GLwDrawingAreaP_h */
  161.